﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace Accouting804.Services
{
    public interface IDataStore<T>
    {
        Task<bool> AddItemAsync(T item);
        Task<bool> UpdateItemAsync(T item);
        Task<bool> DeleteItemAsync(string id);
        Task<T> GetItemAsync(string id);
        Task<IEnumerable<T>> GetItemsAsync(bool forceRefresh = false);
    }

    public interface IDataStoreWithFilterQuery<T> : IDataStore<T>
    {
        Task<IEnumerable<T>> GetItemsFilterQueryAsync(bool forceRefresh = false, string[] queryfilters = null);
    }

    public interface IDataStoreWithWhereQuery<T> : IDataStore<T>
    {
        Task<IEnumerable<T>> GetItemsWithWhereTask(Expression<Func<T, bool>> expression, bool forceRefresh = false);

        IEnumerable<T> GetItemsWithWhere(Func<T, bool> func, bool forceRefresh = false);
    }



}
